<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>阅读注册协议</title>
</head>
<body>

  <!-- <button id="agreeButton" disabled>已阅读用户协议(60)</button>
<script>
  const agreeButton = document.getElementById('agreeButton');
  let second = 60
  const timer = setInterval(() => 
</script> -->

<textarea name="" id="" cols="30" rows="10">
  用户注册协议
  哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
  哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
</textarea>
<br>
<button class="bth" disabled>已阅读用户协议(5)</button>
<script>
  //1.获取元素
  const btn = document.querySelector('.bth')
  //2.倒计时
  let i = 5
  // 2.1 开启定时器
  let n = setInterval(function(){
    i--
    bth.innerHTNL = `我已阅读用户协议(${i})`

    if (i === 0){
      clearInterval(n)//关闭定时器
      //定时器停了，我就可以按按钮
      bth.innerHTNL = `同意`
      bth.disabled = false
    }

  },1000)
</script>
</body>
</html>